<?php
namespace Admin\Controller;
use Think\Controller;
use Admin\Controller\BaseController;
class LoginController extends Controller {
	public function login(){
		$this->display();

	}
	
	public function dologin(){
		$map=array(
			'ydq_adminname'=>I('post.adminname'),
		'ydq_password'=>md5(I('post.password'))
			);
		$admin=M('admin')->where($map)->find();
		if($admin){
			session('admin',$admin);
			$this->redirect('index/index');

		}
		else{
			$this->redirect('login/login');
					}
		
	}
	public function logout(){
		session('admin',null);
		$this->redirect('login/login');
	}





	}?>